/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.swing.*;
import java.awt.*;


/**
 *
 * @author shohdi-user
 */
public class SimpleClassExample extends JFrame {

    private vehicle car;
    private truck lighting;
    
    public SimpleClassExample()
    {
        super ("Simple Class Java Example");
        setSize (600,400);
        setVisible (true);
        setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
        car = new vehicle();
        car.setMake("Ford");
        car.setNumWheels(4);
        lighting = new truck ("Ford SVT","F-150 Lighting","5.4L Triton V8",7700);
    }
    
    public void paint(Graphics g)
    {
        super.paint(g);
        g.setColor(Color.white);
        
        g.fillRect(0, 0,600,400);
        g.setColor(Color.BLACK);
        g.setFont (new Font("Tahoma",Font.PLAIN,12));
        g.drawString("Car Make : " + car.getMake() , 20,50);
        g.drawString("Car Number of Wheels : " + car.getNumWheels() , 20,70);
        g.drawString("Truck make : " + lighting.getMake() , 20,90);
        g.drawString("Truck model : " + lighting.getModel() , 20,110);
        g.drawString("Truck engine : " + lighting.getEngine() , 20,130);
        g.drawString("Truck towing capacity : " + lighting.getTowingCapacity() , 20,150);
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        new SimpleClassExample();
        
    }
}
